package com.plc.wmsentity;

import com.github.s7connector.api.annotation.S7Variable;
import com.github.s7connector.impl.utils.S7Type;
import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class PlcEntity {

    /**
     * type是这个点位在PLC中设置的类型，源码会解析其长度；
     * byteOffset对应PLC偏移量中的整数部分;
     * bitOffset指偏移量的小数部分，bitOffset指第几个bit.
     * byteOffset和bitOffset 也可理解为返回的byte[]中第byteOffset到bitOffset
     */
        public String equipmentNo;

    @S7Variable(type= S7Type.WORD,byteOffset = 52,bitOffset = 0)
    public int equipmentType;

    @S7Variable(type= S7Type.WORD,byteOffset = 54,bitOffset = 0)
    public int state;

    @S7Variable(type= S7Type.STRING,byteOffset = 56,bitOffset = 0)
    public String errorMessage;
}
